<template>
  <div class="card">
    <div 
      v-for="item in list"  
      v-bind:key="item.id" 
      class="item"
      @touchstart.stop="() => $router.push(item.path)"
    >
      <div class="icon">{{ item.icon }}</div>
      <div class="title">{{ item.title }}</div>
    </div>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  setup() {
    const list = ref([
      {
        title: '送样登记',
        id: 1,
        icon: '',
        path: '/mobile/sample-register',
      },
      {
        title: '进度跟踪',
        id: 2,
        icon: '',
        path: '/mobile/my-report-detail',
      },
      {
        title: '报告查看',
        id: 3,
        icon: '',
        path: '/mobile/my-report-detail',
      },
      {
        title: '费用结算',
        id: 4,
        icon: '',
        path: '/mobile/my-report-detail', 
      },
      {
        title: '送检记录',
        id: 5,
        icon: '',
        path: '/mobile/my-report-detail', 
      },
      {
        title: '报告验伪',
        id: 6,
        icon: '',
        path: '/mobile/my-report-result', 
      }
    ])
    return {
      list
    }
  }
}
</script>

<style scoped lang="scss">
.card{
  display: flex;
  flex-wrap: wrap;
  position: relative;
  @include addwh(70rem, 84rem);
  margin: 0 auto;
  margin-top: dpi(-8rem);
  background-color: #ffffff;
  box-shadow: 0rem 1rem 2rem 0rem rgba(5, 32, 77, 0.1);
  &::after{
    display: block;
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #dddddd;
    content: '';
  }
  .item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: dpi(dpi(84rem));
    font-family: PingFangSC-Medium;
    font-size: dpi(2rem);
    font-weight: normal;
    font-stretch: normal;
    letter-spacing: 0rem;
    color: #05204d;
    &:not(&:first-child):not(&:nth-child(2)){
      border-top: 1px solid #dddddd;
    }
    .icon{
      @include addwh(5rem, 6rem);
      margin-bottom: dpi(3rem);
    }

    &:nth-child(1) > .icon {
      background: url('~@/assets/images/icon-1.png') no-repeat center;
      background-size: cover;
    }
    &:nth-child(2) > .icon {
      background: url('~@/assets/images/icon-2.png') no-repeat center;
      background-size: cover;
    }
    &:nth-child(3) > .icon {
      background: url('~@/assets/images/icon-3.png') no-repeat center;
      background-size: cover;
    }
    &:nth-child(4) > .icon {
      background: url('~@/assets/images/icon-4.png') no-repeat center;
      background-size: cover;
    }
    &:nth-child(5) > .icon {
      background: url('~@/assets/images/icon-5.png') no-repeat center;
      background-size: cover;
    }
    &:nth-child(6) > .icon {
      background: url('~@/assets/images/icon-6.png') no-repeat center;
      background-size: cover;
    }
  }
  
}
</style>